/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.usc.cs523.util;

import com.jme3.math.Vector3f;
import com.jme3.network.AbstractMessage;
import com.jme3.network.serializing.Serializable;

/**
 *
 * @author haoxu
 */
@Serializable
public class CeceMessage extends AbstractMessage {

    int id;
    int target;
    int action;
    int message;
    //for location
    float x;
    float y;
    float z;
    //for direction
    float a;
    float b;
    float c;

    public CeceMessage() {
    }

    public CeceMessage(char action, char message) {
        this.action = action;
        this.message = message;
    }

    public int getAction() {
        return action;
    }

    public void setAction(char action) {
        this.action = action;
    }

    public int getMessage() {
        return message;
    }

    public void setMessage(int message) {
        this.message = message;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public float getA() {
        return a;
    }

    public void setA(float a) {
        this.a = a;
    }

    public float getB() {
        return b;
    }

    public void setB(float b) {
        this.b = b;
    }

    public float getC() {
        return c;
    }

    public void setC(float c) {
        this.c = c;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getZ() {
        return z;
    }

    public void setZ(float z) {
        this.z = z;
    }

    public void setPosition(Vector3f position) {
        this.x = position.x;
        this.y = position.y;
        this.z = position.z;
    }

    public void setDirection(Vector3f direction) {
        this.a = direction.x;
        this.b = direction.y;
        this.c = direction.z;
    }

    public int getTarget() {
        return target;
    }

    public void setTarget(int target) {
        this.target = target;
    }

    @Override
    public String toString() {
        return "CeceMessage{" + "id=" + id + ", action=" + action + ", message=" + message + '}';
    }

    public Vector3f getPosition() {
        return new Vector3f(x, y, z);
    }

    public Vector3f getDirection() {
        return new Vector3f(a, b, c);
    }
}
